using JoyfulHomeJourney.BackEnd.Infrastructure.EFCore;
using JoyfulHomeJourney.BackEnd.Infrastructure.Dtos.Responses.Objects;
using JoyfulHomeJourney.BackEnd.Infrastructure.Tools;
namespace JoyfulHomeJourney.BackEnd.Server.Instances.Extends.Responses
{
	public static class SysProductsExtend
{
		public static ResponseSysProductsDto ToResponseDto(this SysProducts entity)
{			return new ResponseSysProductsDto
			{
				brand = entity.PBrand,
				createAt = entity.PCreateAt,
				createAtStr =Tools.TimeToString(entity.PCreateAt),
				deduction = entity.PDeduction,
				description = entity.PDescription,
				discount = entity.PDiscount,
				id = entity.PId,
				images = entity.PImages,
				name = entity.PName,
				price = entity.PPrice,
				rating = entity.PRating,
				saleCount = entity.PSaleCount,
				saleSum = entity.PSaleSum,
				stockQuantity = entity.PStockQuantity,
				productCategory=entity.PCategory,
				updateAt = entity.PUpdateAt,
				updateAtStr =Tools.TimeToString(entity.PUpdateAt),
			};
		}
	}
}
